#include "print.h"
#include "memory.h"

// To make memory management simpler, we may
// take the following strategy:
// 1. Memory allocation on every 4k boundary
// 2. 256 pages
// 3. Free space linked list.

memBlockDescriptor freeList;

void memoryMain ()
{
  myPrintf ("initializing the memory ...\n");
  
  char *start = (char *)0x200000;
  char *end = (char *)0x300000;

  myPrintf ("initial available memory=%dk bytes\n", 1024);
  memBlockDescriptor p = (memBlockDescriptor)start;
  p->length = 1024*1024;
  p->next = 0;
  freeList = start;
  
  myPrintf ("initializing the memory finished\n");
  
  return;
}
